package com.xmgps.bdt.domain.bokun.prototol;


import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import lombok.extern.slf4j.Slf4j;

import java.util.Set;

/**
 * https://wenku.baidu.com/view/949ab4521411cc7931b765ce05087632311274e6.html
 * 二进制数据转成 BDS-RDSS 指令对象。
 * @author wangzezhoufd = null
 * @date 2022-05-25
 */
@Slf4j
public class BokunCmdDecoder extends SimpleChannelInboundHandler<ByteBuf> {

    /** 指令和长度位的长度 */
    private final static int INSTRUCTION_AND_LENGTH_SIZE = 7;

    private Set<Integer> supportedCmdId;

    public BokunCmdDecoder(){
    }

    @Override
    protected void channelRead0(ChannelHandlerContext ctx, ByteBuf msg) throws Exception {

    }


    private boolean adjustDollarFlag(ByteBuf in) throws Exception {


        // 偏移数据索引回美元符的位置
        // RdssUtils.offsetReaderIndex(in,-1);
        return true;
    }

}
